package com.songcha.module_main

import android.app.Application
import android.content.Context
import android.graphics.Color
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.scwang.smart.refresh.footer.ClassicsFooter
import com.scwang.smart.refresh.header.MaterialHeader
import com.scwang.smart.refresh.layout.SmartRefreshLayout
import com.scwang.smart.refresh.layout.api.RefreshFooter
import com.scwang.smart.refresh.layout.api.RefreshHeader
import com.scwang.smart.refresh.layout.api.RefreshLayout
import com.scwang.smart.refresh.layout.listener.DefaultRefreshFooterCreator
import com.scwang.smart.refresh.layout.listener.DefaultRefreshHeaderCreator
import com.songcha.library_business.LibraryBusinessApplication
import com.songcha.library_business.api.MyInterceptor
import com.songcha.library_business.config.VarConfig
import com.songcha.library_business.provider.IApplicationInitProvider
import com.songcha.library_business.proxy.userinfo.UserInfoManager
import com.songcha.library_common.BuildConfig
import com.songcha.library_common.LibraryCommon

@Route(path = "/main/AppInitImpl")
class ModuleMainApplication : Application(),IApplicationInitProvider {
    companion object{
        lateinit var mContext:Context

        @JvmStatic
        fun init(application:Application){
            mContext=application
        }

        init {

        }
    }

    override fun onCreate() {
        super.onCreate()
        mContext=this

        ARouter.openLog()
        ARouter.openDebug()

        ARouter.init(this)

        LibraryCommon.init(this)
        //LibraryBusinessApplication.init(this, BuildConfig.DEBUG)
        //TODO
        UserInfoManager.init()

        MyInterceptor.getInstance().setAccessDeviceEnabled(true)

        VarConfig.TAQ_URL = "https://scwnl.com:304/"

    }

    override fun initApplication(application: Application) {
        //init(application)
        ModuleMainApplication.init(application)
    }

    override fun init(context: Context?) {

    }


}